﻿using Microsoft.AspNetCore.Mvc;
using Fall.Core.Route;

namespace Fall.Core.Extensions
{
    public static class RouteServiceExtension
    {
        /// <summary>
        /// 扩展方法(添加自定义的路由)
        /// </summary>
        /// <param name="opts"></param>
        /// <param name="routeAttribute">自定的前缀内容</param>
        public static void UseCentralRoutePrefix(this MvcOptions opts, RouteAttribute routeAttribute)
        {
            opts.Conventions.Insert(0, new RouteConvention(routeAttribute));
        }
    }
}
